import { useQuery } from "react-query"
import { getCity } from "@/api/reqactquery/index"
export default () => {
  let { isLoading, status, error, data } = useQuery('getcity', (): any => getCity('/citydata.json'))
  if (isLoading) {
    return <div>
      正在加载中……
    </div>
  }

  if (data) {
    return <>
      {
        data.data.map((item: any) => {
          return <h2 key={item.value}>{item.value}</h2>
        })
      }
    </>
  } else {
    return <></>
  }

}